package hk.ust.cse.comp3111.studentSchedule;

import java.util.ArrayList;
import java.util.List;

import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;

import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

public class GroupMeeting extends Fragment {
	
	public GroupMeeting(){}
	
	@Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
 
        View rootView = inflater.inflate(R.layout.group_meeting, container, false);
         
        return rootView;
    }
	
	@Override
	public void onStart() {
		super.onStart();
		
		
		DefaultHttpClient httpclient = new DefaultHttpClient();
		HttpPost httppost = new HttpPost("http://sc-deco.hk/3111/test.php");
		
		List nameValuePairs = new ArrayList<NameValuePair>();
		
		String a="2014-01-02";
		String b="600";
		String c="660";
		String d="2";
        
		try
        {
            nameValuePairs.add(new BasicNameValuePair("a", a));
            nameValuePairs.add(new BasicNameValuePair("b", b));
            nameValuePairs.add(new BasicNameValuePair("c", c));
            nameValuePairs.add(new BasicNameValuePair("d", d));

            httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
            HttpResponse response = httpclient.execute(httppost);
        }
        catch(Exception e)
        {
            e.printStackTrace();
        }
		
		
	}
	
	
}
